using System;
using System.Collections.Generic;

namespace Brilliance.navigation
{
    public class Request
    {
        private readonly IDictionary<Type, Dictionary<string, object>> param;

        public Request(IDictionary<Type, Dictionary<string, object>> param)
        {
            this.param = param;
        }

        public T Get<T>(string qualifier)
        {
            if (param.ContainsKey(typeof (T)))
            {
                return (T) param[typeof (T)][qualifier];
            }
            throw new NotSupportedException(string.Format("Couldn't figure out the parameter of Type {0} with Qualifier {1}", typeof(T), qualifier));
        }

        public T Get<T>()
        {
            return Get<T>("default");
        }
    }
}